//bange_view.hpp
//Copyright (C) 2010-2011 Oscar (.teri) Triano

//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.

//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

#ifndef _bange_view_
#define _bange_view_

#include <iostream>
#include <SFML/Graphics.hpp>
#include <lua5.1/lua.hpp>
#include <bange_base.hpp>
#include <bange_behavior.hpp>
#include <bange_box.hpp>

using namespace std;

namespace bange{
	
	class view: public sf::View, public bange::behavior{
		friend void bange::box::ProcessViews();
		friend void bange::box::ManageEvent(sf::Event &);
		private:
			int refscene;
			float smoothness;
			float scenewidth;
			float sceneheight;
			float newx;
			float newy;
			sf::View *theview;
			sf::FloatRect lastrect;
		public:
			view(sf::FloatRect, lua_State *);
			bool NewIndex(lua_State *);
			bool Index(lua_State *);
			void CleanVM(lua_State *);
			~view();
			static void RegisterVM(lua_State *);
			
	};

}

static int bangeview_NewView(lua_State *);

#endif
